package cn.kgc.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "orders")
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@SuppressWarnings("all")
public class Orders extends Model<Orders> implements Serializable {

    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 用户主键id
     */
    @TableField(value = "user_id")
    private String userId;

    /**
     * 购买用户所在的企业主键id
     */
    @TableField(value = "company_id")
    private String companyId;

    /**
     * 商品名称
     */
    @TableField(value = "item_name")
    private String itemName;

    /**
     * 订单总价
     */
    @TableField(value = "total_amount")
    private Integer totalAmount;

    /**
     * 实际支付总价格
     */
    @TableField(value = "real_pay_amount")
    private Integer realPayAmount;

    /**
     * 邮费;默认可以为零，代表包邮
     */
    @TableField(value = "post_amount")
    private Integer postAmount;

    /**
     * 支付方式
     */
    @TableField(value = "pay_method")
    private Integer payMethod;

    /**
     * 订单状态
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 扩展字段
     */
    @TableField(value = "extend")
    private String extend;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime; //创建时间

    /**
     * 更新时间
     */
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime; //更新时间

}
